/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaDemostrativo.java
 *
 * Created on 17/05/2012, 10:38:13
 */

package br.com.fatecpg.ads.es3.tp.view;

import br.com.fatecpg.ads.es3.tp.bean.BalanceteVerificacaoBean;
import br.com.fatecpg.ads.es3.tp.bean.DemonstrativoBean;
import br.com.fatecpg.ads.es3.tp.business.RegradeNegocio;
import br.com.fatecpg.ads.es3.tp.persistence.ControleCampos;;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import br.com.fatecpg.ads.es3.tp.persistence.Icone;

/**
 *
 * @author roseli
 */
public class TelaDemostrativo extends javax.swing.JFrame {

    /** Creates new form TelaDemostrativo */
    
    RegradeNegocio calc = new RegradeNegocio();
    ControleCampos cc = new ControleCampos();
    public TelaDemostrativo() {
        initComponents();
        this.setLocationRelativeTo(null);
        Icone.Icone(this, "icone.png");
        setTitle("Demonstrativo de Resultado");
        calc.calcDR();
     
        /**
        * lê arquivos de dados salvos para usar na tela de demostrativo
       */
     
       txtRecOpBruta.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getVenda()))));
       txtImpostos.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getIcmsVenda()))));
       txtCmv.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getCmv()))));
       txtDescOb.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getDescOb()))));  
       txtDepreciação.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getDepreciacao()))));
       txtMatEsc.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getMatExp()))));
       txtMatLimp.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getMatLimp()))));
       txtDescConcedido.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getDescConced()))));
       txtAluguelPago.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getAluguelPassivo()))));
       txtEnergiaEletrica.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getEnergia()))));
       txtSalario.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getSalario()))));
       txtEncSociais.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getEncargos()))));
       txtJurosPassivo.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getJurosFinanc()))));
       txtJurosAtivos.setText("0,00");
       txtAluguelRec.setText("0,00");
       txtMatEmb.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getMatEmb()))));
       txtMatHig.setText(cc.colocaVirg(String.valueOf(new DecimalFormat("#.00").format(BalanceteVerificacaoBean.getInstance().getMatHigiene()))));
        
        
        
        txtRecOpLiq.setText(cc.colocaVirg(new DecimalFormat("#.00").format(DemonstrativoBean.getInstance().getRecOperLiquida())));
        txtLucroBruto.setText(cc.colocaVirg(new DecimalFormat("#.00").format(DemonstrativoBean.getInstance().getLucroBruto())));
        txtLair.setText(cc.colocaVirg(new DecimalFormat("#.00").format(DemonstrativoBean.getInstance().getLair())));
        txtProvImpostos.setText(cc.colocaVirg(new DecimalFormat("#.00").format(DemonstrativoBean.getInstance().getIrpj())));
        txtLucroDistribuir.setText(cc.colocaVirg(new DecimalFormat("#.00").format(DemonstrativoBean.getInstance().getLucroDistribuir())));
       

        
       
    }



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        btnPatri = new javax.swing.JButton();
        btnVoltar = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtRecOpBruta = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        txtImpostos = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        txtRecOpLiq = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txtCmv = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        txtLucroBruto = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        txtJurosAtivos = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        txtAluguelRec = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        txtDescOb = new javax.swing.JTextField();
        txtJurosPassivo = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        txtEnergiaEletrica = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        txtAluguelPago = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txtSalario = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        txtLair = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        txtEncSociais = new javax.swing.JTextField();
        txtMatEmb = new javax.swing.JTextField();
        txtMatLimp = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        txtMatHig = new javax.swing.JTextField();
        txtMatEsc = new javax.swing.JTextField();
        txtDepreciação = new javax.swing.JTextField();
        txtDescConcedido = new javax.swing.JTextField();
        txtProvImpostos = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        txtLucroDistribuir = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        btnPatri.setText("B. Patri.");
        btnPatri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPatriActionPerformed(evt);
            }
        });

        btnVoltar.setText("Voltar");
        btnVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVoltarActionPerformed(evt);
            }
        });

        jButton2.setText("Sair");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(42, 42, 42)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnVoltar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnPatri, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(54, 54, 54)
                        .addComponent(jButton2)))
                .addContainerGap(45, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(94, 94, 94)
                .addComponent(btnVoltar)
                .addGap(18, 18, 18)
                .addComponent(btnPatri)
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addContainerGap(98, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Demonstrativo de Resultado"));

        jLabel1.setText("Receita Operacional Bruta");

        txtRecOpBruta.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtRecOpBruta.setEnabled(false);
        txtRecOpBruta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtRecOpBrutaActionPerformed(evt);
            }
        });

        jLabel2.setText("( - ) Impostos");

        txtImpostos.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtImpostos.setEnabled(false);

        jLabel4.setText("= Receita Operacional Liquida");

        txtRecOpLiq.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtRecOpLiq.setEnabled(false);

        jLabel5.setText("( - ) CMV");

        txtCmv.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtCmv.setEnabled(false);

        jLabel11.setText("= Lucro Bruto");

        jLabel12.setText("( + ) RECEITAS");

        txtLucroBruto.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtLucroBruto.setEnabled(false);

        jLabel9.setText("      Juros Ativos / Recebido");

        txtJurosAtivos.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtJurosAtivos.setEnabled(false);

        jLabel10.setText("      Aluguel Recebido");

        txtAluguelRec.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtAluguelRec.setEnabled(false);

        jLabel17.setText("      Desconto Obtido");

        txtDescOb.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtDescOb.setEnabled(false);

        txtJurosPassivo.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtJurosPassivo.setEnabled(false);

        jLabel18.setText("      Juros Passivo");

        jLabel19.setText("      Energia Eletrica");

        txtEnergiaEletrica.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtEnergiaEletrica.setEnabled(false);

        jLabel20.setText("      Aluguel");

        txtAluguelPago.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtAluguelPago.setEnabled(false);

        jLabel13.setText("      Salário");

        txtSalario.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtSalario.setEnabled(false);
        txtSalario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSalarioActionPerformed(evt);
            }
        });

        jLabel21.setText("= Lucro a distribuir");

        txtLair.setEditable(false);
        txtLair.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtLair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtLairActionPerformed(evt);
            }
        });

        jLabel14.setText("( - ) DESPESAS");

        jLabel22.setText("      Encargos Sociais");

        txtEncSociais.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtEncSociais.setEnabled(false);
        txtEncSociais.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtEncSociaisActionPerformed(evt);
            }
        });

        txtMatEmb.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtMatEmb.setEnabled(false);
        txtMatEmb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatEmbActionPerformed(evt);
            }
        });

        txtMatLimp.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtMatLimp.setEnabled(false);
        txtMatLimp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatLimpActionPerformed(evt);
            }
        });

        jLabel23.setText("      Material de Embalagem");

        jLabel24.setText("      Material de Limpeza");

        jLabel25.setText("      Depreciação");

        jLabel26.setText("      Material de Higiene");

        jLabel27.setText("      Material de Escritório");

        jLabel28.setText("      Desconto Concedido");

        txtMatHig.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtMatHig.setEnabled(false);
        txtMatHig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatHigActionPerformed(evt);
            }
        });

        txtMatEsc.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtMatEsc.setEnabled(false);
        txtMatEsc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatEscActionPerformed(evt);
            }
        });

        txtDepreciação.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtDepreciação.setEnabled(false);
        txtDepreciação.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDepreciaçãoActionPerformed(evt);
            }
        });

        txtDescConcedido.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtDescConcedido.setEnabled(false);
        txtDescConcedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDescConcedidoActionPerformed(evt);
            }
        });

        txtProvImpostos.setEditable(false);
        txtProvImpostos.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtProvImpostos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtProvImpostosActionPerformed(evt);
            }
        });

        jLabel29.setText("( - ) Provisão IRPJ + CSLL");

        txtLucroDistribuir.setEditable(false);
        txtLucroDistribuir.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtLucroDistribuir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtLucroDistribuirActionPerformed(evt);
            }
        });

        jLabel30.setText(" = LAIR (Lucro Antes do Imposto de Renda)");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel30))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(37, 37, 37)
                                .addComponent(jLabel29))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel21)))
                        .addGap(186, 186, 186)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtLucroDistribuir, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
                            .addComponent(txtProvImpostos)
                            .addComponent(txtLair)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel27)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtMatEsc, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel26)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtMatHig, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel24)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtMatLimp, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel23)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtMatEmb, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel22)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtEncSociais, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel13)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtSalario, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel20)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtAluguelPago, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel19)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtEnergiaEletrica, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel18)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtJurosPassivo, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel17)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtDescOb, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel10)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtAluguelRec, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel9)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtJurosAtivos, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel5)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtCmv, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel4)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtRecOpLiq, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtImpostos, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel11)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtLucroBruto, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(272, 272, 272)
                                    .addComponent(txtRecOpBruta, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel25)
                                        .addComponent(jLabel28))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(txtDescConcedido)
                                        .addComponent(txtDepreciação, javax.swing.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)))))))
                .addGap(251, 251, 251))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtRecOpBruta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtImpostos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(txtRecOpLiq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(txtCmv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txtLucroBruto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(txtJurosAtivos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(txtAluguelRec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDescOb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel14)
                .addGap(8, 8, 8)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(txtJurosPassivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtEnergiaEletrica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtAluguelPago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(txtSalario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(txtEncSociais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMatEmb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMatLimp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24))
                .addGap(15, 15, 15)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(txtMatHig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(txtMatEsc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(txtDepreciação, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(txtDescConcedido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(txtLair, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(txtProvImpostos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(txtLucroDistribuir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 924, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 341, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtRecOpBrutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtRecOpBrutaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtRecOpBrutaActionPerformed

    private void txtSalarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSalarioActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtSalarioActionPerformed

    private void txtLairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLairActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtLairActionPerformed

    private void txtEncSociaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEncSociaisActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtEncSociaisActionPerformed

    private void txtMatEmbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatEmbActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatEmbActionPerformed

    private void txtMatLimpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatLimpActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatLimpActionPerformed

    private void txtMatHigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatHigActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatHigActionPerformed

    private void txtMatEscActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatEscActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatEscActionPerformed

    private void txtDepreciaçãoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDepreciaçãoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtDepreciaçãoActionPerformed

    private void txtDescConcedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDescConcedidoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtDescConcedidoActionPerformed

    private void txtProvImpostosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtProvImpostosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtProvImpostosActionPerformed

    private void txtLucroDistribuirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLucroDistribuirActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtLucroDistribuirActionPerformed

    private void btnPatriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPatriActionPerformed
//        try {
//            escreveDados();
//        } catch (IOException ex) {
//        }
        TelaBalancoPatrimonial telaBalancoPatrimonial = new TelaBalancoPatrimonial();
                telaBalancoPatrimonial.setVisible(true);

    }//GEN-LAST:event_btnPatriActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        int opcao = JOptionPane.showConfirmDialog(null, "Deseja relmente sair do sistema?", "Esta ação é irreversivel", JOptionPane.YES_NO_OPTION);
        if (opcao == JOptionPane.YES_OPTION) {
            System.exit(0);
        } else {
            setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void btnVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVoltarActionPerformed
            dispose();
    }//GEN-LAST:event_btnVoltarActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TelaDemostrativo().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnPatri;
    private javax.swing.JButton btnVoltar;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField txtAluguelPago;
    private javax.swing.JTextField txtAluguelRec;
    private javax.swing.JTextField txtCmv;
    private javax.swing.JTextField txtDepreciação;
    private javax.swing.JTextField txtDescConcedido;
    private javax.swing.JTextField txtDescOb;
    private javax.swing.JTextField txtEncSociais;
    private javax.swing.JTextField txtEnergiaEletrica;
    private javax.swing.JTextField txtImpostos;
    private javax.swing.JTextField txtJurosAtivos;
    private javax.swing.JTextField txtJurosPassivo;
    private javax.swing.JTextField txtLair;
    private javax.swing.JTextField txtLucroBruto;
    private javax.swing.JTextField txtLucroDistribuir;
    private javax.swing.JTextField txtMatEmb;
    private javax.swing.JTextField txtMatEsc;
    private javax.swing.JTextField txtMatHig;
    private javax.swing.JTextField txtMatLimp;
    private javax.swing.JTextField txtProvImpostos;
    private javax.swing.JTextField txtRecOpBruta;
    private javax.swing.JTextField txtRecOpLiq;
    private javax.swing.JTextField txtSalario;
    // End of variables declaration//GEN-END:variables

//    public void escreveDados()throws IOException{
//     try {
//            escrever.escDados(txtLucroDistribuir.getText(), "LucroDestribuir.txt");
//            escrever.escDados(txtProvImpostos.getText(), "ImpostoIrpj.txt");
//        } catch (IOException ex) {
//            Logger.getLogger(TelaDemostrativo.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    }
}
